package com.spring.study.service.impl;

import com.spring.study.mapper.GoodMapper;
import com.spring.study.pojo.Good;
import com.spring.study.service.GoodService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
@Slf4j
public class GoodServiceImpl implements GoodService {

    @Autowired
    private GoodMapper goodMapper;

    @Override
    public int addGood(Good good) {
        good.setCreateTime(new Date());
        log.info("good:{}",good);
        return goodMapper.insertSelective(good);
    }
}
